include_once("assets/snippets/shoppingCart/dbconfig.inc.php");
include_once ("manager/includes/controls/datagrid.class.php");
echo '<input type="hidden" name="id" value="' . $id . '" />';

echo '<input type="hidden" name="listmode" value="' . $listmode . '" />';

echo '<input type="hidden" name="op" value="" />';

$sessionid = session_id();

echo '<br />';
echo '<div>';
echo '<style type="text/css">';
echo '/* grid style */';
echo '.grid {';
echo '    width: 100%;';
echo '    float: right;';
echo '    background-color: #fff;';
echo '    border: 1px solid silver;}';

echo '.gridHeader {';
echo '    color: #fff;';
echo '    font-weight: bold;';
echo '    background-color: #2095B2;'; // was 8FC70C 14D0FF
echo '    height: 25px;';
echo '    border: 1px solid #177084; }'; // was 006400 2B75FF 0400FF

echo '.gridItem {';
echo '    background-color: #fff;';
echo '    padding: 3px; }';

echo '.gridAltItem {';
echo '    background-color: #eeeeee;';
echo '    padding: 3px; }';

echo '.gridRowIcon:hover {';
echo '    background-color: #f5f5dc;'; // was f5f5dc
echo '}';

echo '</style>';

	mysql_select_db($dbname);
        $res = mysql_query('SELECT id FROM ' . $kiwee->config['fpx'] . 'cart_header WHERE session_id="' . $sessionid . '"') or die ("MYSQL1" . mysql_error());
        $hid = mysql_fetch_row($res);
        $sql = 'SELECT name, quantity, amount FROM ' . $kiwee->config['fpx'] . 'cart_detail AS A INNER JOIN ' . $kiwee->config['fpx'] . 'items AS B ON A.item_id=B.id WHERE header_id=' . $hid[0];
        $ds = mysql_query($sql) or die ("MYSQL: " . mysql_error());

	$grd = new DataGrid('',$ds, $number_of_results);

	$grd->noRecordMsg = "No Items in Cart";

	$grd->cssClass="grid";

	$grd->columnHeaderClass="gridHeader";

	$grd->itemClass="gridItem";
 
        $grd->altItemClass="gridAltItem";

	$grd->fields="name, quantity, amount";

	$grd->columns= "Name, Qty, Price"; 

	$grd->colWidths="100, 50, 50";

	$grd->colAligns="left, left, left";

	$grd->colTypes=",,currency";

//template:<form id="action_viewdetails-[+sku+]" action="#" method="post"><input class="itema_viewdetailsitem_button" type="submit" value="Details" name="viewdetailsitems"></form>, ||template:<form id="action_updateitem-[+sku+]" action="#" method="post"><input class="itema_updateitem_button" type="submit" value="Update" name="updateitems"></form>, 
	if($listmode=='1') $grd->pageSize=0;

	if($_REQUEST['op']=='reset') $grd->pageNumber = 1;

	echo $grd->render();
